Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sanitize argument-free object params before logging #19771

Merged
merged 17 commits into from
Jun 6, 2024

Conversation

V0XNIHILI
Copy link
Contributor

@V0XNIHILI V0XNIHILI commented Apr 12, 2024

What does this PR do?

This PR sanitizes object params before they get logged to WandB and Neptune.

Fixes #19772

Before submitting
  • Was this discussed/agreed via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or minor internal changes/refactors)

PR review

Anyone in the community is welcome to review the PR.
Before you start reviewing, make sure you have read the review guidelines. In short, see the following bullet-list:

Reviewer checklist
  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified

I had fun coding :D


📚 Documentation preview 📚: https://pytorch-lightning--19771.org.readthedocs.build/en/19771/

@github-actions github-actions bot added fabric lightning.fabric.Fabric pl Generic label for PyTorch Lightning package labels Apr 12, 2024
@V0XNIHILI V0XNIHILI marked this pull request as ready for review April 12, 2024 20:21
@V0XNIHILI V0XNIHILI marked this pull request as draft April 12, 2024 20:26
…arams in test case, just like in the actual code
@V0XNIHILI V0XNIHILI marked this pull request as ready for review April 12, 2024 21:03
@V0XNIHILI V0XNIHILI changed the title Sanitize object params before logging Sanitize argument-free object params before logging Apr 12, 2024
Copy link

codecov bot commented Apr 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59%. Comparing base (a611de0) to head (08698f7).
Report is 94 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (a611de0) and HEAD (08698f7). Click for more details.

HEAD has 99 uploads less than BASE
Flag BASE (a611de0) HEAD (08698f7)
python3.10 19 12
cpu 64 40
lightning 39 27
pytest 45 26
examples 8 0
app 8 0
python3.8 12 10
lightning_fabric 10 9
python3.11 20 18
tpu 1 0
pytorch2.0 12 9
pytest-full 24 18
pytorch2.1 6 5
pytorch_lightning 10 8
pytorch2.3 3 2
pytorch2.2 3 2
lightning_app 1 0
Additional details and impacted files
@@            Coverage Diff            @@
##           master   #19771     +/-   ##
=========================================
- Coverage      84%      59%    -25%     
=========================================
  Files         426      421      -5     
  Lines       35280    35185     -95     
=========================================
- Hits        29616    20775   -8841     
- Misses       5664    14410   +8746     

@mergify mergify bot removed the has conflicts label May 21, 2024
@V0XNIHILI
Copy link
Contributor Author

@awaelchli could you have a look at this PR? It's been open and ready for a while now and it is quite a simple change. Let me know what you think!

@awaelchli awaelchli requested a review from tchaton as a code owner June 6, 2024 15:23
@awaelchli awaelchli added this to the 2.3 milestone Jun 6, 2024
Copy link
Contributor

@awaelchli awaelchli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great @V0XNIHILI
Thanks for sending the fix.
I pushed minor changes (the test wasn't passing because you asserted the repr, but the repr would only apply to an instance anyway).

@awaelchli awaelchli added logger Related to the Loggers community This PR is from the community labels Jun 6, 2024
@awaelchli awaelchli merged commit 4f96c83 into Lightning-AI:master Jun 6, 2024
122 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community This PR is from the community fabric lightning.fabric.Fabric logger Related to the Loggers pl Generic label for PyTorch Lightning package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sanitize object params before they get logged from argument-free classes
2 participants